# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=gsettings-desktop-schemas

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=3.11.5
pkgrel=1
arch=('any')
url="http://live.gnome.org/"
pkgdesc="Shared GSettings schemas for the desktop (mingw-w64)"
depends=("${MINGW_PACKAGE_PREFIX}-glib2")
makedepends=("${MINGW_PACKAGE_PREFIX}-gobject-introspection" "intltool")
license=('GPL')
options=('strip' 'staticlibs')
install=schemas-${CARCH}.install
source=("http://ftp.gnome.org/pub/GNOME/sources/${_realname}/${pkgver%.*}/${_realname}-$pkgver.tar.xz"
    0001-give-cc-to-gir-scanner.mingw.patch)
md5sums=('aa2862708ded0a32acaf9c49609b167f'
         '9cddb874978e1f502bf6d143476047d1')

prepare() {
  cd "$srcdir/${_realname}-$pkgver"

  patch -Np1 -i "$srcdir/0001-give-cc-to-gir-scanner.mingw.patch"
  
  autoreconf -fi
}

build()
{
  rm -rf $srcdir/build-${MINGW_CHOST}
  mkdir $srcdir/build-${MINGW_CHOST}
  cd $srcdir/build-${MINGW_CHOST}
    ../${_realname}-$pkgver/configure \
      --prefix=${MINGW_PREFIX} \
      --build=${MINGW_CHOST} \
      --host=${MINGW_CHOST} \
      --target=${MINGW_CHOST} \
      --disable-schemas-compile
  make
}

package() {
    cd "$srcdir/build-${MINGW_CHOST}"
    make DESTDIR="$pkgdir" install
}
